{template 'common/header'}
<title>项目促销</title>
<style type="text/css">
    *{margin:auto;}
    body {margin:0; font-family:'微软雅黑'; background:#FFF;}
    a:link,a:visited,a:active{color:#fff;text-decoration:none;}
    a{ text-decoration: none;}
    .title{width:100%;height:200px;}
    .title img{width:100%;height:100%;}
    .btn{width:100%;height:50px;background:#FFB72B;position:fixed;bottom:0;color:#fff;font-size:20px;font-weight:bold;text-align:center;line-height:50px;}
    .btn a{width:100%;height:50px;display:inline-block;}
    .main{width:80%;height:350px;}
    .content{width:100%;height:150px;border-radius:10px;text-align:center;}
    .content .content-con{width:100%;height:150px;}
    .content .content-con .gender{width:50%;height:20px;float:left;margin-top:10px;text-align:left;}
    .content .content-con .gender-in{width:100%;height:20px;text-align:left;font-size:12px;float:left;color:#AEB5C3;}
    .content .content-con .neirong{width:100%;height:100px;float:left;border:1px solid #CAD3E0;}
    .content .content-con .neirong .xingshi{width:90%;height:50px;border-bottom:1px dashed #000;line-height:50px;text-align:left;}
    .content .content-con .neirong .tiaojian{width:90%;height:50px;line-height:50px;text-align:left;}
</style>
<div class='title'><img src="../addons/ewei_shop/template/mobile/default/static/images/jiameng/chuxiao.png"></div>
<div class='main'>
    <input type="hidden" id="gender" value="1" />
    <div class="content">
        <div class="content-con">
            <span class="gender" data-val="1"><i class="fa fa-check-circle-o" style="color:#0C9;"></i> 项目一</span>
            <div class="gender-in">One PROJECT</div>
            <div class='neirong'>
                <div class="xingshi">促销形式：</div>
                <div class="tiaojian">促销条件：</div>
            </div>
        </div>
    </div>
    <div class="content" style="margin-top:2px;">
        <div class="content-con">
            <span class="gender" data-val="2"><i class="fa fa-circle-o"></i> 项目二</span>
            <div class="gender-in">TWO PROJECT</div>
            <div class='neirong'>
                <div class="xingshi">促销形式：</div>
                <div class="tiaojian">促销条件：</div>
            </div>
        </div>
    </div>
</div>
<div class='btn' id='submit'>
    <a href='javascript:;'>提交申请</a>
</div>
<script language="javascript">
    $('.gender').click(function() {
        var $this = $(this);
        var val = $this.data('val');
        window.sex = val;
        $('.gender').find('i').css('color', '#999').removeClass('fa-check-circle-o').addClass('fa-circle-o');
        $(this).find('i').removeClass('fa-circle-o').addClass('fa-check-circle-o').css('color', '#0c9');
        $('#gender').val(val);
    })
</script>
<script language="javascript">
    require(['tpl', 'core'], function(tpl, core) {   
                            $('#submit').click(function(){
                               val=$('#gender').val();
                                core.json('franchise/center',{
                                    op:'promote_submit',
                                    promote_id:val
                                 },function(postjson){
                                     if(postjson.status==1){
                                        alert("提交成功！");
                                        $("#submit").html('提交申请').removeAttr('saving');
                                     }
                                     if(postjson.status==-1){
                                         core.tip.show('您已提交过，不能重复提交！'); 
                                         $("#submit").html('提交申请').removeAttr('saving');
                                     }
                                     if(postjson.status==0){
                                         core.tip.show('操作失败'); 
                                         $("#submit").html('提交申请').removeAttr('saving');
                                     }
                                },true,true);
                           }); 
    });
</script>
{template 'common/footer'}